﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved All Rights Reserved All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using System.Reflection;
using System.Diagnostics;

namespace FinPlusAssembler
{
    public static class AssemblyExtension
    {
        public static string Path(this Assembly assembly)
        { 
            return assembly.Location.Replace(assembly.ManifestModule.Name, string.Empty).ToLower(); 
        }

        public static string[,] Info(this Assembly assembly)
        {
            var f = FileVersionInfo.GetVersionInfo(assembly.Location);
            string[,] info = {{"Version", f.ProductVersion}, 
                               {"Company", f.CompanyName},
                               {"Decsription", f.FileDescription},
                               {"Copyright", f.LegalCopyright}};
            return info;
        }

        public static string ConfigPath(this Assembly assembly)
        {
            return assembly.Location.ToLower().Replace(".exe", ".config").Replace(".dll", ".config");
        }
    }
}
